package io.gps.datatransfer.task.taskentity;

import io.gps.datatransfer.CenterChannel;
import io.gps.datatransfer.utils.SysDef;
import org.apache.log4j.Logger;


public class CreateSessonWork implements Runnable  {

    private static Logger logger = Logger.getLogger(CreateSessonWork.class);

    String sim;
    /**
     * 批量执行数据解析
     * @param sim
     */
    public CreateSessonWork(String sim) {
        this.sim = sim;
    }
    @Override
    public void run() {
        try {

            for (int i = 0; i < SysDef.UP_SERVER.size(); i++) {
                CenterChannel center = SysDef.sim_server_center.get( SysDef.getserverkey(sim,SysDef.UP_SERVER.get(i).getServerid()));
                if(center==null||center.devServer.getServerid()==null){
                    CenterChannel newCenter=new CenterChannel(SysDef.UP_SERVER.get(i),sim);
                    SysDef.sim_server_center.put( SysDef.getserverkey(sim,SysDef.UP_SERVER.get(i).getServerid()),newCenter);
                }
            }

        } catch (Exception ie) {
            logger.error("创建链接失败",ie);
        }
    }
}